package day09;

/*
 * Author: JacksonCoder
 * FileName: ArraysExample
 * Version: 1.0.0
 * Date: 2025/4/15
 */

import java.util.Arrays;

public class ArraysExample {
    public static void main(String[] args) {
        int[] nums = {5,3,7,9,1};

        // 逆序排序
        Arrays.sort(nums, 0, 3);
        Arrays.sort(nums, 3, 5);
        System.out.println(Arrays.toString(nums));

        Arrays.sort(nums); // 排序
        System.out.println(Arrays.toString(nums)); //

        int index = Arrays.binarySearch(nums,5);  // 二分查找
        System.out.println("Index of 5: " + index);  //


    }
}
